#include "mainwindow.h"
#include "global.h"
#include <QApplication>
#include <QFile>
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QFile qss(":/style/stylesheet.qss");

    if( qss.open(QFile::ReadOnly))
    {
        qDebug("qss open success");
        QString style = QLatin1String(qss.readAll());
        a.setStyleSheet(style);
        qss.close();
    }else{
         qDebug("qss open failed");
     }
    //读取config.ini
    QString app_path = QCoreApplication::applicationDirPath();
    //拼接文件名
    //QString fileName = "config.ini";
    //QString config_path = QDir::toNativeSeparators(app_path +QDir::separator() + fileName);
    //有点问题
    QSettings settings("D:\\happysummer\\happychat\\client\\llfcchat\\config.ini", QSettings::IniFormat);
    QString gate_host = settings.value("GateServer/host").toString();
    QString gate_port = settings.value("GateServer/port").toString();
    gate_url_prefix = "http://"+gate_host+":"+gate_port;
    qDebug() <<gate_url_prefix<<endl;
    MainWindow w;
    w.show();

    return a.exec();
}
